-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Filter &
from tag name
#959
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to a880fdf in 9 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. python/composio/utils/enums.py:5
- Draft comment:
Consider using a set forcharacters_to_replace
for faster membership testing, although the current list is small and performance impact is minimal. - Reason this comment was not posted:
Confidence changes required:33%
The change is straightforward and correct, but there's a potential performance improvement.
Workflow ID: wflow_kYixT7rXxwqcvItb
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -2,7 +2,7 @@ | |||
|
|||
|
|||
def get_enum_key(name: str) -> str: | |||
characters_to_replace = [" ", "-", "/", "(", ")", "\\", ":", '"', "'", "."] | |||
characters_to_replace = [" ", "-", "/", "(", ")", "\\", ":", '"', "'", ".", "&"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider defining this list as a module-level constant to improve maintainability and reusability. Example:
SPECIAL_CHARACTERS = [" ", "-", "/", "(", ")", "\\", ":", '"', "'", ".", "&"]
def get_enum_key(name: str) -> str:
for char in SPECIAL_CHARACTERS:
name = name.replace(char, "_")
return name.upper()
@@ -2,7 +2,7 @@ | |||
|
|||
|
|||
def get_enum_key(name: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding docstring to improve code documentation:
def get_enum_key(name: str) -> str:
"""Convert a string into a valid enum key by replacing special characters with underscores.
Args:
name (str): The input string to be converted
Returns:
str: The converted string in uppercase with special characters replaced by underscores
Example:
>>> get_enum_key("Hello & World")
'HELLO_WORLD'
"""
Code Review SummaryThe change looks good and addresses the issue of handling Strengths:✅ Simple and focused fix Suggestions for improvement:
Overall, the PR is ready to merge with the suggested improvements being optional for future enhancements. |
This comment was generated by github-actions[bot]! JS SDK Coverage Report📊 Coverage report for JS SDK can be found at the following URL: 📁 Test report folder can be found at the following URL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on e3f7265 in 7 seconds
More details
- Looked at
21
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. python/tests/test_tools/test_toolset.py:52
- Draft comment:
The test case was updated to reflect changes in the application name fromlinear
toattio
. Ensure that this change is consistent with the rest of the codebase. - Reason this comment was not posted:
Confidence changes required:50%
The test casetest_uninitialize_app
was updated to reflect changes in the application name fromlinear
toattio
. This change aligns with the PR description, which mentions updating tag names. The test case now correctly tests for theattio
app, ensuring that the error message and action schema are consistent with the new application context.
Workflow ID: wflow_NCUEIInw2VH4zaZE
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Update
get_enum_key
inenums.py
to replace&
with_
in tag names and modify an error message intest_toolset.py
.get_enum_key
inenums.py
to replace&
with_
in tag names.test_uninitialize_app()
intest_toolset.py
to useattio
instead oflinear
.This description was created by for e3f7265. It will automatically update as commits are pushed.